/**
 * [485] 最大连续 1 的个数
 *
 * @format
 * @lc app=leetcode.cn id=485 lang=javascript
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxConsecutiveOnes = function (nums) {
    let countMax = (countNow = 0)
    for (let i = 0; i < nums.length; i++) {
        nums[i] ? countNow++ : (countNow = 0)
        countNow > countMax ? (countMax = countNow) : null
    }
    return countMax
}
// @lc code=end
